<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			a{color: yellow;}  /* 权重 1 */
			
			div a{color: green;} /* 1 + 1 */
			
			.demo a{color: black;} /* 10 + 1 */
			
			#demo a{color: orange;}  /* 100 + 1 */
			
			div#demo a{color: red;} /* 1 + 100 + 1 */
		</style>
	</head>
	<body>
		<a href="">应该是黄色</a>
		<div class="demo">
			<a href="">应该是黑色</a>
		</div>
		<div id="demo">
			<a href="">应该是红色</a>
		</div>
	</body>
</html>
